# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-bdd5
pkgver=5.0.0
pkgrel=2
pkgdesc='BDD library for the pytest runner (legacy 5.x branch)'
arch=('any')
license=('MIT')
url='https://github.com/pytest-dev/pytest-bdd'
provides=("python-pytest-bdd=$pkgver")
depends=('python-glob2' 'python-mako' 'python-parse' 'python-parse-type' 'python-py' 'python-pytest')
makedepends=('python-setuptools')
source=("https://github.com/pytest-dev/pytest-bdd/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('827e57d410b05207b6c646062ddb54b677e22441311820d3bd406df202b6e9344dedf59cd4868e89cfbf8606fe3f15559e4cc3958d100e4fa74f9b864e6faada')

build() {
  cd pytest-bdd-$pkgver
  python setup.py build
}

check() {
  # Hack entry points by installing it

  cd pytest-bdd-$pkgver
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  PATH="$PWD/tmp_install/usr/bin:$PATH" PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH" pytest
}

package() {
  cd pytest-bdd-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
